const web = require("../../module/web"), loger = require("../../module/loger");

module.exports.run = (yzm)=>{
	web.run((w)=>{
		let fm = w.window.document.getElementsByName("frm_reg_tel");
		if(fm && fm[0]){
			fm = fm[0];
			fm.email.value = global.sdObj.ud[3];
			fm.psw.value = global.sdObj.ud[10];
			fm.msgvcode.value = yzm;
			let inp = w.window.document.getElementsByClassName("subIcoTel");
			if(inp && inp[0]) inp[0].click();
		}
	},(w)=>{
		let tp = w.window.document.getElementsByClassName("tipInfor");
		for(let i=0;i<tp.length;i++){
			if(tp[i].clientWidth > 0){
				if(tp[i].innerHTML.indexOf("验证码输入错误") > 0){
					global.sdObj.end = 1034;			
				}else{
					global.sdObj.end = 1011;
				}
				return true;
			}
		}
		if(w.window.location.href.indexOf("/classic/index.php") > 0){
			global.sdObj.end = 0;
			return true;
		}
	});
}